{* $Id$ *}
{include_core file="admin/lib/header.html" user_name="余额记录列表"}
  <div class="page-header border-bottom clearfix">
    <h2 class="left">余额记录管理<span>在这里对余额进行管理</span></h2>
    <a href='{AnUrl("user_money/admin/user_money?{URLTracker::set("is_excel", "1")}")}' class="btn btn-success btn-sm right">导出Excel</a>
  	<a href="{AnUrl('user/admin/index')}" class="btn btn-default btn-sm right">&lt;&nbsp;返回用户列表</a>
  </div>
  <div class="search-form js_advancedForm">
    <form action="{AnUrl('user_money/admin/user_money')}" method="get" class="js_focusSearchForm">
      <input type="hidden" name="status" value="{$status}">
      <p>
        <label class="search-f-label">用户名：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[user_name]" value="{URLTracker::val('search_filter','user_name')}">
      </p>
      <p>
        <label class="search-f-label">操作人：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[admin_name]" value="{URLTracker::val('search_filter','admin_name')}">
      </p>
      <p>
      <label class="search-f-label">添加时间：</label>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[start_date]" value="{URLTracker::val('search_filter','start_date')}" id="startDate">
        <span class="search-f-line"></span>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[end_date]" value="{URLTracker::val('search_filter','end_date')}" id="stopDate">
      </p>
      <p>
          <label class="search-f-label"></label>
          <button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button>
          <a href="{AnUrl('user_money/admin/user_money')}" class="btn btn-default btn-xs">重置</a>
      </p>
    </form>
  </div>
  <div class="list-table-filters">
    <p>
      <span class="label label-info">按来源</span>
      <a href='{AnUrl("user_money/admin/user_money?{URLTracker::set("res_id", "0")}")}' {if URLTracker::val("res_id") == 0} class="label label-primary" {else} class="label label-default" {/if}>全部</a>
      {foreach $user_money_type as $k => $v}
      <a href='{AnUrl("user_money/admin/user_money?{URLTracker::set("res_id", $v["id"])}")}' {if URLTracker::val("res_id") == $v["id"]} class="label label-primary" {else} class="label label-default" {/if}>{$v.res_name}</a>
      {/foreach}
    </p>
  </div>
  <!--start:列表-->
  <table class="list-table">
    <thead><tr>
      {if $status == 1}
      <th style="width:20px;"><input type="checkbox" style="padding:6px;border:1px solid #999;background-color:white;border-radius:2px;" class="selectAll"></th>
      {/if}
      <th style="min-width:140px;" colspan="2">变更</th>
      <th style="min-width:120px;">余额</th>
      <th style="min-width:120px;">来源</th>
      <th>操作人</th>
      <th style="min-width:120px;">记录时间</th>
      <th style="min-width:200px;">订单&店铺&合伙人信息</th>
      <th style="min-width:260px;">备注</th>
    </tr></thead>
    <tbody>
      {foreach $user_money_list as $k => $v}
        <tr id="dataList{$v.id}" {if $k%2 == 1} class="bg-gray"{/if} data-id="{$v.id}">
          {if $status == 1}
          <td><input type="checkbox" style="padding:6px;border:1px solid #999;background-color:white;border-radius:2px;" class="js_listSelect" /></td>
          {/if}
          <td>{$v.user_name}</td>
          <td>{$v.realname}</td>
          <td>{$v.user_money}</td>
          <td>{$v.res_name}</td>
          <td>{$v.admin_name}</td>
          <td>{$v.add_time}</td>
          <td>
              {if $v.order_info}
                  <p>订单号:
                  {if $v.order_info.type == 5}
                  <a href="{AnUrl("order/admin/store_order?search_filter[order_code]={$v.order_info.order_no}")}" target="_blank">{$v.order_info.order_no}</a>
                  {else}
                  <a href="{AnUrl("order/admin?status=1&type=1&search_filter[order_code]={$v.order_info.order_no}")}" target="_blank">{$v.order_info.order_no}</a>
                  {/if}
                   </p><br>
              {/if}

              {if $v.store_info}
                <p>店铺id:{$v.store_info.id}</p>
                <p>店铺名称:{$v.store_info.title}({$v.store_info.title_branch})</p><br>
              {/if}

              {if $v.agency_info}
              <p>合伙人id:{$v.agency_info.id}</p>
              <p>合伙人姓名:{$v.agency_info.realname}</p>
              {/if}
          </td>
          <td>{$v.extra}</td>
        </tr>
      {foreachelse}
          <tr><td class="txtleft" colspan="9">暂无数据</td></tr>
      {/foreach}
    </tbody>
  </table>
  {include_core file="admin/lib/pager.html"}
<!--end:列表-->
{load_js file='zclip/jquery.zclip.min.js'}
{load_js file='zclip/ZeroClipboard.js'}
{include_core file="admin/lib/footer.html"}